<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr=[1,2];
        var [x,y]=arr;
        console.log(x,y);

        var arr2=[2,3];
        var [x,y]=arr;
        [y,x]=[x,y];
        console.log(x,y);

        var {name:name1,child:{name:name2}}={name:"刘德华",child:{name:"周杰伦"}};
        console.log(name1,name2);
    </script>
</body>
</html>